#!/bin/sh
svc=ffclient
if ! grep -q '^'$svc':' /etc/passwd ; then
  busybox adduser -h /dev/null/$svc -s /bin/false -S -D -G video $svc 2>/dev/null
fi
[ "$1" = "--prereqs" ] && exit 0
res=640x480
fps=15
dev=/dev/video0
url=http://localhost:8091/cam1.ffm
exec chpst -u $svc ffmpeg -nostats -f v4l2 -s $res -r $fps -i $dev $url 2>&1
